package com.wuliupai.delivery.wuliupaidelivery.utils;

import android.content.Intent;

import java.util.ArrayList;
import java.util.List;

/**
 * 类：
 * 作者：康慧丽
 * 时间：2016/7/12 10:11
 * 邮箱：khl8912@126.com
 */
public class PlaceUtil {

//  public static final int Index_ProvinceCode = 0;//省码
//  public static final int Index_CityCode = 1;//市码
//  public static final int Index_AreaCode = 2;//县码
  public static final int Index_ProvinceName = 3;//省名
  public static final int Index_CityName = 4;//市名
  public static final int Index_AreaName = 5;//县名

    /**
     * 省市县名称和代码统一管理
     *
     * @param data 返回的数据
     * @return
     */
    public static List<String> resultDispose(Intent data) {
        List<String> list_place = new ArrayList<>();
        String provinceCode = data.getStringArrayExtra("province")[0];
        String cityCode = data.getStringArrayExtra("city")[0];
        String areaCode = data.getStringArrayExtra("area")[0];
        String privinceName = data.getStringArrayExtra("province")[1];
        String cityName = data.getStringArrayExtra("city")[1];
        String areaName = data.getStringArrayExtra("area")[1];

        list_place.add(provinceCode);
        list_place.add(cityCode);
        list_place.add(areaCode);
        list_place.add(privinceName);
        list_place.add(cityName);
        list_place.add(areaName);

        return list_place;
    }

}
